package ws.jonas.common.model;

/**
 * Immutable.
 */
public class Store  {
	private final String address;
	private final String city;
	private final String county;

	public Store(String address, String city, String county) {
		this.address = address;
		this.city = city;
		this.county = county;
	}

	public String getAddress() {
		return address;
	}

	public String getCity() {
		return city;
	}

	public String getCounty() {
		return county;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof Store)) {
			return false;
		}
		Store other = (Store) obj;
		if (address == null) {
			if (other.address != null) {
				return false;
			}
		} else if (!address.equals(other.address)) {
			return false;
		}
		if (city == null) {
			if (other.city != null) {
				return false;
			}
		} else if (!city.equals(other.city)) {
			return false;
		}
		if (county == null) {
			if (other.county != null) {
				return false;
			}
		} else if (!county.equals(other.county)) {
			return false;
		}
		return true;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((address == null) ? 0 : address.hashCode());
		result = prime * result + ((city == null) ? 0 : city.hashCode());
		result = prime * result + ((county == null) ? 0 : county.hashCode());
		return result;
	}

	@Override
	public String toString() {
		return "Store[ address=" + address + ", city=" + city + ", county=" + county + " ]";
	}
}
